<?php 
require 'config.php';
ob_clean();

$iCat = getValue('iCat');
$page = getValue('iPage');

$page = ($page >= 2) ? $page : 1;
$rows_per_page = 24;
$page_start = ($page - 1) * $rows_per_page;
$page_end = $page * $rows_per_page;
//Khối tin cat
$db_list_news = new db_query('SELECT new_id,new_title,new_date,new_picture,new_teaser,new_detail,new_tags,new_relate,new_active,
                                    new_cat_id,cat_id,cat_name
                                FROM news 
                                LEFT JOIN categories_multi ON cat_id = new_cat_id 
                                WHERE new_cat_id = '.$iCat.' AND new_active = 1
                                ORDER BY new_id DESC 
                                LIMIT '.$page_start . ', '. $rows_per_page);
$list_news = $db_list_news->resultArray();
unset($db_list_news);
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="vi" lang="vi" xmlns:og="http://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<link href="<?=DOMAIN?>/favicon.png" type="image/x-icon" rel="shortcut icon"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="initial-scale=1, maximum-scale=1.0, minimum-scale=1.0" name="viewport" />
<meta name="AUTHOR" content="Vnupdate" />
<meta name="description" content="Tin cập nhật, tin tức mới nhất, tin tức online về chủ đề: <?=$list_news[0]['cat_name']?>"/>
<meta name="COPYRIGHT" content="Copyright (C) 2012 VnUpdate.net" />
<meta name="ROBOTS" content="INDEX, FOLLOW" />
<meta name="RATING" content="GENERAL" />
<?/*    Facebook content    */ ?>
<meta property="og:title" content="Tin cập nhật về <?=$list_news[0]['cat_name']?>" />
<meta property="og:type" content="article" />
<meta property="og:url" content="<?=$_SERVER['REQUEST_URI']?>" />
<meta property="og:image" content="<?=DOMAIN?>/themes/img/logo.png" />
<meta property="og:site_name" content="VnUpdate" />
<meta property="og:description" content="Tin cập nhật, tin tức mới nhất, tin tức online về chủ đề: <?=$list_news[0]['cat_name']?>" />
<meta property="fb:admins" content="100004609203263" />
<meta property="fb:app_id" content="447585838689244"/>
<title>Tin cập nhật về <?=$list_news[0]['cat_name']?></title>
<link rel="stylesheet" type="text/css" href="/themes/css/home.css" />
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-43837292-2', 'vnupdate.net');
  ga('send', 'pageview');

</script>
</head>
<body>
    <div class="header">
        <div class="logo">
            <a href="/"><img src="../themes/img/logo.png" alt="Logo vnupdate.net" /></a>
        </div><!-- End logo -->
        <div class="navigation">
            <script type="text/javascript">
                var show_menu = 0;
                function showMenu(){
                    if(show_menu == 0){
                    document.getElementById('nav-menu').style.display = 'block';
                    show_menu = 1;
                    }else{
                    document.getElementById('nav-menu').style.display = 'none';
                    show_menu = 0;
                    }
                }
            </script>
            <span class="breadcrumb_date"><?=getDateTime('','1','1','0','',time())?></span>
            <span onclick="showMenu()" class="menu_button">CHUYÊN MỤC <b class="caret"> </b></span>
            <ul id="nav-menu" class="nav-menu">
                <li class="<?=$iActive == 1 ? 'active' : ''?>">
                    <a href="/">Home</a>
                </li>  
                <li class="<?=$iCat == 1 ? 'active' : ''?>">
                    <a href="/xa-hoi.htm">Xã hội</a>
                </li> 
                <li class="<?=$iCat == 2 ? 'active' : ''?>">
                    <a href="/the-gioi.htm">Thế giới</a>
                </li> 
                <li class="<?=$iCat == 3 ? 'active' : ''?>">
                    <a href="/kinh-te.htm">Kinh tế</a>
                </li> 
                <li class="<?=$iCat == 4 ? 'active' : ''?>">
                    <a href="/phap-luat.htm">Pháp luật</a>
                </li>
                <li class="<?=$iCat == 5 ? 'active' : ''?>">
                    <a href="/bong-da.htm">Bóng đá</a>
                </li>
                <li class="<?=$iCat == 6 ? 'active' : ''?>">
                    <a href="/cong-nghe.htm">Công nghệ</a>
                </li>
                <li class="<?=$iCat == 7 ? 'active' : ''?>">
                    <a href="/van-hoa.htm">Văn hóa</a>
                </li>
                <li class="<?=$iCat == 14 ? 'active' : ''?>">
                    <a href="/giai-tri.htm">Giải trí</a>
                </li>
                <li class="<?=$iCat == 8 ? 'active' : ''?>">
                    <a href="/khoa-hoc.htm">Khoa học</a>
                </li>
                <li class="<?=$iCat == 12 ? 'active' : ''?>">
                    <a href="/tinh-yeu-gioi-tinh.htm">Giới tính</a>
                </li>
                <li class="<?=$iCat == 9 ? 'active' : ''?>">
                    <a href="/gioi-tre.htm">Giới trẻ</a>
                </li>
                <li class="<?=$iCat == 10 ? 'active' : ''?>">
                    <a href="/giao-duc.htm">Giáo dục</a>
                </li>
                <li class="<?=$iCat == 11 ? 'active' : ''?>">
                    <a href="/o-to-xe-may.htm">Xe ++</a>
                </li>
                 <li class="<?=$iCat == 13 ? 'active' : ''?>">
                    <a href="/chuyen-la.htm">Chuyện lạ</a>
                </li>
            </ul> 
        </div><!-- End navigation -->
    </div><!-- End header -->
    <div class="breadcrumb">
    	<span itemtype="http://data-vocabulary.org/Breadcrumb" itemscope="itemscope" class="crumb_item">
    		<a itemprop="url" rel="up" class="crumb" href="<?=DOMAIN?>/"><span itemprop="title">Trang chủ</span></a>
    		<span class="arrow"><img src="<?=$path_images_page?>navRow.png" alt="bredcrumb arrow"/></span>
    	</span>
    	<span itemtype="http://data-vocabulary.org/Breadcrumb" itemscope="itemscope" class="crumb_item">
    		<a itemprop="url" rel="up" class="crumb" href="<?=DOMAIN?>/<?=removeTitle($list_news[0]['cat_name'])?>.htm"><span itemprop="title"><?=$list_news[0]['cat_name']?></span></a>
    	</span>
    </div>
    <div class="new_home_title">
        <h2 class="">Tin tức <?=$list_news[0]['cat_name']?> cập nhật</h2>
    </div>
    <div id="new_home" class="new_home">
    <?
    foreach($list_news as $key=>$news_new) {
        ?>
        <div class="new_home_item">
            <div class="img">
                <a href="<?=generate_detail_url($news_new)?>">
                    <img alt="<?=$news_new['new_title']?>" src="<?=$news_new['new_picture']?>" />
                </a>
            </div>
            <a class="info_title" href="<?=generate_detail_url($news_new)?>"><h2><?=$news_new['new_title']?></h2></a>
            <!--</a><p class="info_content"><?=$news_new['new_teaser'] != '' ? cut_string(removeHTML($news_new['new_teaser']),70) : cut_string(removeHTML($news_new['new_detail']),70)?></p>-->
        </div>
        <?            
    }
    ?> 
    </div>
    <div class="footer">
        <h3>© Copyright 2013 - VnUpdate.net, All rights reserved</h3>
    </div><!-- End footer -->
<script type="text/javascript" src="/themes/js/mobile.js"></script>
</body>
</html>
